<link rel="stylesheet" href="../static/bootstrap/css/bootstrap.min.css" type="text/css">
<link rel="stylesheet" href="../static/jBox/Skins/Metro/jbox.css" type="text/css">
<link rel="stylesheet" href="../static/dist/css/AdminLTE.min.css" type="text/css">
<link rel="stylesheet" href="../static/css/admin.css" type="text/css">
<link rel="stylesheet" href="../static/plugins/treeTable/jquery.treetable.css" type="text/css">
<link rel="stylesheet" href="../static/plugins/treeTable/jquery.treetable.theme.default.css" type="text/css">
<link rel="stylesheet" href="../static/plugins/datatables/jquery.dataTables.css" type="text/css">
<link rel="stylesheet" href="../static/plugins/daterangepicker/daterangepicker.css" type="text/css">
<link rel="stylesheet" href="../static/plugins/datepicker/datepicker3.css" type="text/css">
<style>
.ul_tree_display {
	display: none;
}

.tr_tree_display {
	display: none;
}

.table>tbody>tr>td {
	vertical-align: middle;
	font-size: 0.8em;
}

.layui-layer-content p {
	padding: 15px;
}

.dataTables_length {
	margin-top: 10px;
}
label{
	text-align: right;
}
</style>
<div class="tabs-panel">
	<div class="row">
		<div class="col-xs-12">
			<div class="box">
				<div class="box-header">
					<form action="/coupon/coupon-report" id="coupon-report-select" method="post">
						<input id="search_count" name="search_count" value="0" type="hidden"/>
						<input name="is_export" id="is_export" value="1" type="hidden"/>
    					<div class="box-body">
        					<label class="col-sm-1">优惠券类型：</label>
        					<div class="col-sm-2">
            					<select class="depart-input" style="width:100%" id="type" name="type">
            					<option value="">全部</option>
            					<?php 
            					if (is_array($GLOBALS['_COUPON_TYPE']) && count($GLOBALS['_COUPON_TYPE']) > 0)foreach ($GLOBALS['_COUPON_TYPE'] as $type=>$type_name){
            					?>
            					<option value="<?=$type?>"><?=$type_name?></option>
            					<?php }?>
            					</select>
        					</div>
        					<label class="col-sm-1">优惠券ID：</label>
        					<div class="col-sm-2">
        						<input class="depart-input" name="coupon_id" id="coupon_id" type="text" style="width:100%" placeholder="">
        					</div>
        					<label class="col-sm-1">优惠券名称：</label>
        					<div class="col-sm-2">
        						<input class="depart-input" name="title" id="title" type="text" style="width:100%" placeholder="">
        					</div>
        					<button type="button" class="btn btn-primary depart-modal" onclick="table_list_reload()" style="width: 100px;">查询</button>
        					&nbsp;
        					<button type="button" class="btn btn-warning depart-modal" id="reset_button" style="width: 100px;">重置</button>
    					</div>
    					<div class="box-body">
        					<label class="col-sm-1">兑换状态：</label>
        					<div class="col-sm-2">
            					<select class="depart-input" style="width: 100%" id="is_exchange" name="is_exchange">
                					<option value="">全部</option>
                					<?php 
                					if (is_array($GLOBALS['_COUPON_EXCHANGE_STATUS']) && count($GLOBALS['_COUPON_EXCHANGE_STATUS']) > 0)foreach ($GLOBALS['_COUPON_EXCHANGE_STATUS'] as $exchange=>$exchange_name){
                					?>
                					<option value="<?=$exchange?>"><?=$exchange_name?></option>
                					<?php }?>
            					</select>
        					</div>
        					<label class="col-sm-1">领取时间：</label>
        					<div class="col-sm-2">
        						<input class="depart-input" name="receive_time" id="receive_time" style="width:70%;float:left" placeholder="请选择领取时间" type="text">
        						<button type="button" class="btn btn-primary depart-modal" onclick="$('#receive_time').val('')" style="width:25%;float:right">清空</button>
        					</div>
        					<label class="col-sm-1">兑换时间：</label>
        					<div class="col-sm-2">
        						<input class="depart-input" name="exchange_time" id="exchange_time" style="width:70%;float:left" placeholder="请选择兑换时间" type="text">
        						<button type="button" class="btn btn-primary depart-modal" onclick="$('#exchange_time').val('')" style="width:25%;float:right">清空</button>
        					</div>
        					<a href="javascript:void(0)" onclick="exportCouponReport()" style="margin-left:20px;font-size:16px;text-decoration:underline ;">Excel导出</a>
    					</div>
					</form>
				</div>
				<div class="box-body">
					<table id="table_list" class="table table-bordered table-hover">
						<thead>
							<tr>
								<th class="">序号</th>
								<th class="">优惠券类型</th>
								<th class="">优惠券ID</th>
								<th class="">优惠券名称</th>
								<th class="">手机号</th>
								<th class="">领取时间</th>
								<th class="">兑换时间</th>
								<th class="">领取来源</th>
								<th class="">兑换状态</th>
							</tr>
						</thead>
						<tbody>
						</tbody>
					</table>
				</div>
			</div>
		</div>
	</div>
</div>
<!-- 固定js -->
<script type="text/javascript" src="/static/plugins/jQuery/jquery-2.2.3.min.js"></script>
<script type="text/javascript" src="/static/bootstrap/js/bootstrap.min.js"></script>
<script type="text/javascript" src="/static/plugins/datatables/jquery.dataTables.min.js"></script>
<script type="text/javascript" src="/static/plugins/datatables/dataTables.bootstrap.min.js"></script>
<script type="text/javascript" src="/static/jBox/jquery.jBox-2.3.min.js"></script>
<script type="text/javascript" src="/static/jBox/i18n/jquery.jBox-zh-CN.js"></script>
<script type="text/javascript" src="/static/plugins/treeTable/jquery.treetable.js"></script>
<!-- 时间插件 -->
<script type="text/javascript" src="../static/plugins/moment/moment.min.js"></script>
<script type="text/javascript" src="../static/plugins/daterangepicker/daterangepicker.js"></script>
<script type="text/javascript" src="../static/plugins/datepicker/bootstrap-datepicker.js"></script>
<!-- 自定义js -->
<script type="text/javascript" src="/static/app/global.js?version=<?=Yii::$app->params['version']?>"></script>
<script type="text/javascript" src="/static/app/coupon/report.js?version=<?=Yii::$app->params['version']?>"></script>
<script>
	var coupon_type = <?=(is_array($GLOBALS['_COUPON_TYPE']) && count($GLOBALS['_COUPON_TYPE']) > 0 ? json_encode($GLOBALS['_COUPON_TYPE']) : '') ?>;
	var use_mark = <?=(is_array($GLOBALS['_COUPON_USE_MARK']) && count($GLOBALS['_COUPON_USE_MARK']) > 0 ? json_encode($GLOBALS['_COUPON_USE_MARK']) : '') ?>;
	var exchange_status = <?=(is_array($GLOBALS['_COUPON_EXCHANGE_STATUS']) && count($GLOBALS['_COUPON_EXCHANGE_STATUS']) > 0 ? json_encode($GLOBALS['_COUPON_EXCHANGE_STATUS']) : '') ?>;
</script>